<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>{&SITE_TITLE}</title>
    <script type="text/javascript" src="__PUBLIC__/language/{$lang}/lang.js" ></script>
	<script type="text/javascript" src="__PUBLIC__/js/jquery.js"></script>
	<link href="__PUBLIC__/admin/css/layout.css" rel="stylesheet" type="text/css" />
	<link href="__PUBLIC__/js/pagination/pagination.css" rel="stylesheet" type="text/css" />	
	<script type="text/javascript">
		var ctrl = function(name){
			this.elements = document.getElementsByName('id[]');
			this.length = this.elements.length;
		}
		ctrl.prototype = {
			reverse:function(){
				for(i=0;i<this.length;i++){
					this.elements[i].checked= !this.elements[i].checked;
				}
			},
			all:function(){
				for(i=0;i<this.length;i++){
					this.elements[i].checked = true;
				}
			},
			unAll:function(){
				for(i=0;i<this.length;i++){
					this.elements[i].checked = false;
				}
			},
			toggle:function(obj){
				this[obj.checked ? 'all' : 'unAll']();
			},
		
		}
		var c = null;
	</script>
    
	</head>
	<body>
		
<div id="container">
	<div class="tab">
	<ul>
		<volist id="vo" name="menulist">
			<php>$class=($key==ACTION_NAME)?'class="on"':''</php>
			<li><a {$class} href="{:U('group/Admin/'.$key)}">{$vo}</a></li>
		</volist>
	</ul>
</div>
			<table class="tableborder" width="100%">
			<form action="" method="post" autocomplete="off">
				<tbody>
					<tr class="top">
						<td class="border"></td>
					</tr>
					<tr>
						<th class="header">tips</th>
					</tr>
					<tr>
						<td class="tips">
							<ul>
								<li>插件管理</li>
							</ul>
						</td>
					</tr>
					<tr class="bottom">
						<td class="border" colspan="5">&nbsp;</td>
					</tr>
				</tbody>
			</table>
			<table class="tableborder" width="100%">
				
				<tbody>
					<tr class="top">
						<td class="border" colspan="7"></td>
					</tr>
					<tr>
						<th class="header" colspan="7"> (一共有 {:count($list)} 个插件)</th>
					</tr>
					<tr class="label">
						<th style="width:50px;">编号</th>
						<th style="width:80px;">插件名称 </th>
						<th style="width:100px;">Action名称</th>
						<th style="width:420px;">
							<ul style="list-style:none;">
								<li style="float:left;width:90px;text-align:center;">访问</li>
								<li style="float:left;width:90px;text-align:center;">添加</li>
								<li style="float:left;width:90px;text-align:center;">编辑</li>
								<li style="float:left;width:90px;text-align:center;">删除</li>
							</ul>
						</th>
						<th style="width:80px;">默认安装</th>
						<th>操作</th>
					</tr>
<volist id="vo" name="list">
		<tr class="cell altbg2" style="height:30px;" id="tr_{$vo.id}">
		<td>{$vo.id}</td>
		<td>{$vo.name}</td>
		<td>{$vo.actionname}</td>
		<td>
							<ul style="list-style:none;">
								<li style="float:left;width:80px;text-align:center;">
								<select name="popedom[{$vo.id}][visit]" id="select6">
						              <option <eq name="vo['initdata']['visit']" value="0">selected</eq>  value="0">所有人</option>
						              <option <eq name="vo['initdata']['visit']" value="1">selected</eq>  value="1">团队成员</option>
						              <option <eq name="vo['initdata']['visit']" value="2">selected</eq>  value="2">仅管理员</option>
	            				</select>
								</li>
								<li style="float:left;width:80px;text-align:center;">
						            <select name="popedom[{$vo.id}][add]" id="select6">
						              <option <eq name="vo['initdata']['add']" value="0">selected</eq>  value="0">团队成员</option>
						              <option <eq name="vo['initdata']['add']" value="1">selected</eq>  value="1">仅管理员</option>
						            </select>
								</li>
								<li style="float:left;width:80px;text-align:center;">
						            <select name="popedom[{$vo.id}][edit]" id="select6">
						              <option <eq name="vo['initdata'][edit]" value="0">selected</eq>  value="0">发布者</option>
						              <option <eq name="vo['initdata'][edit]" value="1">selected</eq>  value="1">仅管理员</option>
						            </select>
								</li>
								<li style="float:left;width:80px;text-align:center;">
						            <select name="popedom[{$vo.id}][del]" id="select6">
						              <option <eq name="vo['initdata'][del]" value="0">selected</eq>  value="0">发布者</option>
						              <option <eq name="vo['initdata'][del]" value="1">selected</eq>  value="1">仅管理员</option>
						            </select>
								</li>
							</ul>
		</td>
		<td ><input type="checkbox" name="definstall[{$vo.id}]" <eq name="vo['definstall']" value="1">checked</eq> value="1"></td>
		<td><a href="{:U('group/Admin/plugs',array('pid'=>$vo['id']))}">编辑</a> 
			<a href="javascript:void(0)" onclick="dodel({$vo.id})">删除</a></td>
	</tr>
</volist>
					<tr>
						<td class="footer" colspan="5">
							<input type="submit" class="button" value="修改" />
						</td>
					</tr>
					<tr class="bottom">
						<td class="border" colspan="7">&nbsp;</td>
					</tr>
				</tbody>
				</form>
			</table>
			<table class="tableborder" width="100%">
			<form action="{:U('group/Admin/doplugs')}" method="POST">			
			<present name="info">								
				<input type="hidden" name="type" value="edit">
			<else />
				<input type="hidden" name="type" value="add">
			</present>			
			<input type="hidden" name="pid"  value="{$info.id}">
				<tbody>
					<tr class="top">
						<td class="border" colspan="2"></td>
					</tr>
					<tr>
						<th class="header" colspan="2">添加组件</th>
					</tr>
					<tr class="label">
						<th>说明</th>
						<th>设置</th>
					</tr>
					<tr class="cell">
						<td class="altbg1">
							<b>组件名:</b>
							<br/>
							<span class="smalltxt">组件名称</span>
						</td>
						<td class="altbg2"><input name="name" value="{$info.name}" class="txt"/></td>
					</tr>
					<tr class="cell">
						<td class="altbg1">
							<b>默认安装:</b>
							<br/>
							<span class="smalltxt">默认安装</span>
						</td>
						<td class="altbg2"><input type="checkbox" <eq name="info['definstall']" value="1">checked</eq> name="definstall" value="1"/></td>
					</tr>
					
					<tr class="cell">
						<td class="altbg1">
							<b>ActionName:</b>
							<br/>
							<span class="smalltxt">组件操作名</span>
						</td>
						<td class="altbg2"><input name="actionname" value="{$info.actionname}" class="txt"/> </td>
					</tr>
					
					<tr class="cell">
						<td class="altbg1">
							<b>快速发布:</b>
							<br/>
							<span class="smalltxt">快速发布</span>
						</td>
						<td class="altbg2"><input name="quickname" value="{$info.quickname}" style="width:50px" class="txt"/> - <input name="quickurl" value="{$info.quickurl}" style="width:50px" class="txt"/>  例： 发表 - add</td>
					</tr>										
													
					<tr class="cell">
						<td class="altbg1">
							<b>权限设置:</b>
							<br/>
							<span class="smalltxt">默认权限设置</span>
						</td>
						<td class="altbg2">
							<ul style="list-style:none;">
								<li style="float:left;width:100px;text-align:center;">访问</li>
								<li style="float:left;width:100px;text-align:center;">添加</li>
								<li style="float:left;width:100px;text-align:center;">编辑</li>
								<li style="float:left;width:100px;text-align:center;">删除</li>
							</ul>
							<br>
							<ul style="list-style:none;">
								<li style="float:left;width:100px;text-align:center;">
								<select name="initdata[visit]" id="select6">
						              <option <eq name="info['initdata']['visit']" value="0">selected</eq>  value="0">所有人</option>
						              <option <eq name="info['initdata']['visit']" value="1">selected</eq>  value="1">团队成员</option>
						              <option <eq name="info['initdata']['visit']" value="2">selected</eq>  value="2">仅管理员</option>
	            				</select>
								</li>
								<li style="float:left;width:100px;text-align:center;">
						            <select name="initdata[add]" id="select6">
						              <option <eq name="info['initdata']['add']" value="0">selected</eq>  value="0">团队成员</option>
						              <option <eq name="info['initdata']['add']" value="1">selected</eq>  value="1">仅管理员</option>
						            </select>
								</li>
								<li style="float:left;width:100px;text-align:center;">
						            <select name="initdata[edit]" id="select6">
						              <option <eq name="info['initdata'][edit]" value="0">selected</eq>  value="0">发布者</option>
						              <option <eq name="info['initdata'][edit]" value="1">selected</eq>  value="1">仅管理员</option>
						            </select>
								</li>
								<li style="float:left;width:100px;text-align:center;">
						            <select name="initdata[del]" id="select6">
						              <option <eq name="info['initdata'][del]" value="0">selected</eq>  value="0">发布者</option>
						              <option <eq name="info['initdata'][del]" value="1">selected</eq>  value="1">仅管理员</option>
						            </select>
								</li>
							</ul>
						</td>
					</tr>	
					
					<tr class="cell">
						<td class="altbg1">
							<b>组件描述:</b>
							<br/>
							<span class="smalltxt">对组件的描述</span>
						</td>
						<td class="altbg2">
							<textarea cols="60" name="description" rows="5" >{$info.description}</textarea>
						</td>
					</tr>
					<tr>
						<td class="footer" colspan="2">
							<present name="info">								
								<input type="submit" class="button" value="修改" />
							<else />
								<input type="submit" class="button" value="添加" />
							</present>
						</td>
					</tr>
					<tr class="bottom">
						<td class="border" colspan="5">&nbsp;</td>
					</tr>
				</tbody>
			  </form>
			</table>
		</div>
	
	</body>
</html>
<script>
	function dodel(pid){
		alert('删除功能会影响到团队内插件的使用，暂时不开放');
		return false;
		$.post("{:U('group/Admin/doplugs')}",{pid:pid,type:'del'},function(txt){
			
		})
		
	}
</script>
